<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>场馆出入统计</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/guobo/trailLog/">场馆出入统计</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="exhOutInReport" action="${ctx}/guobo/exhoutinreport/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>物料编码：</label>
				<form:input path="assetCode" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>物料名称：</label>
				<form:input path="assetName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>物料规格：</label>
				<form:input path="assetSpec" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>物料型号：</label>
				<form:input path="assetModle" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<%-- <li><label>开始时间：</label>
				<input name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${exhOutInReport.startTime}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<li><label>结束时间：</label>
				<input name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${exhOutInReport.endTime}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li> --%>
			<li><label>展会：</label>
				<select name="exhibitionId" class="input-medium">
					<option value="">----请选择----</option>
					<c:forEach items="${exhibitions}" var="exhibition">
						<c:if test="${exhibition.id eq exhibitionId }">
							<option value="${exhibition.id}" selected="selected">${exhibition.name}</option>
						</c:if>
						<c:if test="${exhibition.id ne exhibitionId }">
							<option value="${exhibition.id}">${exhibition.name}</option>
						</c:if>						
					</c:forEach>
				</select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>物料编码</th>
				<th>物料名称</th>
				<th>物料规格</th>
				<th>物料型号</th>
				<c:forEach items="${exhHalls}" var="exhall">
					<th>${exhall.name}</th>
				</c:forEach>
				<th>出馆合计</th>
				<c:forEach items="${exhHalls}" var="exhall">
					<th>${exhall.name}</th>
				</c:forEach>				
				<th>入馆合计</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="exhoutinreport">
			<tr>
				<td>
					${exhoutinreport.assetCode}					
				</td>
				<td>
					${exhoutinreport.assetName}
				</td>
				<td>
					${exhoutinreport.assetSpec}
				</td>
				<td>
					${exhoutinreport.assetModle}
				</td>
				<c:forEach items="${exhoutinreport.exhOuts}" var="exhOut">
					<td>
						出
						<c:if test="${exhOut.outNum ne '0'}">
							<font color="red">${exhOut.outNum}</font>
						</c:if>
						<c:if test="${exhOut.outNum eq '0'}">
							${exhOut.outNum}
						</c:if>
					</td>
				</c:forEach>
				<td>
					${exhoutinreport.totalOutNum}
				</td>
				<c:forEach items="${exhoutinreport.exhIns}" var="exhIn">
					<td>
						入
						<c:if test="${exhIn.inNum ne '0'}">
							<font color="red">${exhIn.inNum}</font>
						</c:if>
						<c:if test="${exhIn.inNum eq '0'}">
							${exhIn.inNum}
						</c:if>
					</td>
				</c:forEach>
				<td>
					${exhoutinreport.totalInNum}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>